<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="Author" content="Dennis Sigel">
   <META NAME="COPYRIGHT" CONTENT="Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.">
   <meta name="GENERATOR" content="Mozilla/4.5 [en] (X11; I; SunOS 5.7 sun4u) [Netscape]">
</head>
<body>

<h3>Histogram:</h3>
<p>
<strong>Demo</strong><br>
The histogram demo on the following page displays a single band gray
level image, a small inset navigator window which allows the image to
be panned, a display of the color map, and a control panel containing
buttons to perform histogram related operations on the displayed image.
The button functions include reset the entire display, perform histogram
equalization, perform histogram normalization using the JAI "matchcdf"
operator, and perform a piecewise linear mapping using the JAI "piecewise"
operator.
</p>

<p>
<strong>JAI</strong><br>
The primary tasks needed to obtain a histogram are as follows:
<pre>
  1. Create a Histogram object, which specifies
     the type of histogram to be generated.

  2. Create a Histogram operation with
     the required parameters or create a
     ParameterBlock with the parameters and
     pass it to the Histogram operation.

  3. Read the histogram data stored in the
     object.
</pre>

<p>
<strong>Theory</strong><br>
A histogram provides a view of the intensity profile of an
image and is often displayed as a bar chart.  Pixel values are
partitioned and counted with the population of each partition value placed
in its own bin.  The pixel intensities are plotted along the horizontal x-axis
while the number of occurrences for each intensity are plotted along
the vertical y-axis.  Histograms can be viewed as probability density functions.
</p>

<p>
For a single band 8 bit image there are 256 possible intensity values. For
example, the intensities range from 0 to 255, inclusively, for an unsigned
byte image. Given a single band 8 bit image that is 128 by 128 with values
all set to zero the resulting histogram would have a single spike at 0
with a bin count of 16384 and all other 255 bins having count 0.  The
sum of all bin counts in a histogram should match the number of collected
samples.
</p>
<br>
</body>
</html>
